﻿@{
    var model = Session["HomeViewModel"] as HomeViewModel;
    List<MenuViewModel> menus = new List<MenuViewModel>();
    if (model != null)
    {
        menus = model.Menus;
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - My ASP.NET MVC Application</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Scripts.Render("~/bundles/modernizr")
    @Styles.Render("~/Content/bootstrap.css")
    @Styles.Render("~/Content/template.css")
    @Scripts.Render("~/Scripts/jquery-1.7.1.min.js")
    @Scripts.Render("~/Scripts/bootstrap.min.js")
    <script type="text/javascript">
        var urlHome = "@Url.Action("Index", "Home", new { name = "trangchu".ToSeoUrl(), id = 1 })";
        
        $(document).ready(function () {
            $('.logo').bind('click', function () {
                window.location.href = urlHome;
            });
        });

        
    </script>
</head>
<body>
    <div class="container-fluid" style="padding: 0px;">
        <div class="row-fluid">
            <div class="header">
                <div class="container" style="margin: 0 auto; width: 1150px;">
                    <div class="logo">
                    </div>
                    <div class="row-fluid">
                        <div style="position: absolute; top: 70px;">
                            <a id="drop1" href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                                Shopping Categories</a>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="drop1" @Html.Raw(ViewData["MainMenu"])>
                                @{
                                    int index = 0;
                                    foreach (var parentMenu in menus)
                                    {
                                        var top = -2;
                                        index += 1;
                                        if (index == 1) { top = -2; }
                                        if (index == 2) { top = -4; }
                                        //if (index == 3) { top = -111; }
                                        //if (index == 4) { top = -164; }
                                        //if (index == 5) { top = -217; }
                                        //if (index == 6) { top = -270; }
                                        //if (index == 7) { top = -323; }
                                    
                                    <li role="presentation" class="dropdown-submenu"><a role="menuitem" tabindex="-1"
                                        href="@Url.Action("View", "Categories", new { id = parentMenu.ID })">@Html.Raw(parentMenu.Name)<br />
                                        <font style="font-size: 11px;">@Html.Raw(parentMenu.Description)</font> </a>
                                        <ul class="dropdown-menu dropdown-menu-replace">
                                            <li>
                                                <div class="popover-content1" style="width: 687px; position: relative; top: @Html.Raw(top)px;
                                                        left: -5px;">
                                                    <div style="height: 390px; padding: 15px;">
                                                        <p>
                                                            @Html.Raw(parentMenu.Name):</p>
                                                        <ul role="menu">
                                                            @foreach (var subMenu in parentMenu.SubMenus)
                                                            {
                                                                <li><a href="@Url.Action("View", "Categories", new { name = subMenu.Name.ToSeoUrl(), id = subMenu.ID })">@Html.Raw(subMenu.Name)</a>
                                                                    <p class="span-description">@Html.Raw(subMenu.Description)</p>
                                                                </li>
                                                            }
                                                        </ul>
                                                    </div>
                                                </div>
                                            </li>
                                        </ul>
                                    </li>
                                    <li role="presentation" class="divider"></li>
                                    }
                                }
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Tất cả danh mục </a>
                            </ul>
                        </div>
                        <div class="navbar" style="margin-top: 55px;">
                            <div class="navbar-inner" style="padding: 0px;">
                                <div class="container">
                                    <div class="nav-collapse collapse navbar-responsive-collapse">
                                        <div style="margin-left: 220px;">
                                            <div class="input-prepend input-append" style="width: 610px; float: left;">
                                                <span class="add-on"><i class="icon-search"></i></span>
                                                <input type="text" class="form-control" placeholder="Tìm kiếm..." style="width: 580px;"
                                                    data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]">
                                                <button class="btn" type="button">
                                                    <b>Go</b></button>
                                            </div>
                                        </div>
                                        <ul class="nav pull-right">
                                            <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Hello,
                                                Minh<b class="caret"></b></a>
                                                <ul class="dropdown-menu">
                                                    <li><a href="#">Thông tin người dùng</a></li>
                                                    <li><a href="#">Danh sách đặt hàng</a></li>
                                                    <li class="divider"></li>
                                                    <li><a href="#">Đăng xuất</a></li>
                                                </ul>
                                            </li>
                                            <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Giỏ
                                                hàng (1) <b class="caret"></b></a>
                                                <ul class="dropdown-menu">
                                                    <li><a href="#">Tổng số tiền: <b>5,123,000 VND</b></a></li>
                                                    <li class="divider"></li>
                                                    <li><a href="@Url.Action("CheckAccount", "Cart")">Thanh Toán</a></li>
                                                    <li><a href="@Url.Action("Index", "Cart")">Xem giỏ hàng</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- /.nav-collapse -->
                                </div>
                            </div>
                            <!-- /navbar-inner -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        @RenderBody()
    </div>
    @RenderSection("scripts", required: false)
</body>
</html>
